{% extends 'index.html' %}
{#{% load stu_tags %}#}
{% block page-content %}
{#学生首页#}

<div class="panel panel-default">
  <!-- Default panel contents -->
  <div class="panel-heading">我的活动</div>
  <div class="panel-body">
        <table class="table table-striped table-responsive">
{#            {{ request.user.userprofile.stu_accout }}#}
      <thead>
        <tr>
            <th>活动名称</th>
            <th>届数</th>
            <th>主办学院</th>
            <th>开始日期</th>
            <th>结束日期</th>
            <th>活动进度</th>
            <th>我的成绩</th>
            <th>作业管理</th>
        </tr>
      </thead>
      <tbody>
        {% for enroll_obj  in request.user.userprofile.stu_accout.enrollment_set.all %}
            <tr>
                <td>{{ enroll_obj.enrolled_class.course }}</td>
                <td>{{ enroll_obj.enrolled_class.semester }}</td>
                <td>{{ enroll_obj.enrolled_class.branch }}</td>
                <td>{{ enroll_obj.enrolled_class.start_date }}</td>
                <td>{{ enroll_obj.enrolled_class.end_date }}</td>
                <td>已过{{ enroll_obj.enrolled_class.courserecord_set.all.count }}天</td>
{#                <td>{% get_score enroll_obj request.user.stu_account as score_data %}#}
{#                    {{ score_data.score__sum }}#}
{#                </td>#}
{#                <td><a href="{% url 'studyrecords' enroll_obj.id %}">作业管理</a></td>#}
            </tr>
        {% endfor %}

      </tbody>
    </table>
  </div>
</div>
{% endblock %}